package project1.dao;

import project1.data.DataSet;
import project1.entity.Book;

public class BookDaoImpl implements BookDao {
    public Book query(String id) {
        Book[] books = DataSet.books;// 索取所有的书籍信息
        for (Book book : books) {// 遍历所有的书籍信息
            if (book.getBid().equals(id))
                return book;
        }
        return null;// 没有找到任何书籍信息抛出异常
    }

    public Book[] query() {
        return DataSet.books;
    }
}